﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;

namespace Admin.Finance
{
    public partial class MainInvoiceShow : System.Web.UI.Page
    {
        public string strid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    strid = Request.Params["id"];
                    int MainInvoiceId = (Convert.ToInt32(strid));
                    ShowInfo(MainInvoiceId);
                }
            }
        }

        private void ShowInfo(int MainInvoiceId)
        {
            ChinaSoft.BLL.Common.Bind bllBind = new ChinaSoft.BLL.Common.Bind();
            DataSet ds = bllBind.GetDataSet("*", "V_FinaceMainInvoiceList", "MainInvoiceId="+MainInvoiceId);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr = ds.Tables[0].Rows[0];
                this.lblContractNumber.Text = dr["ContractNumber"].ToString();
                this.lblCustomer.Text =dr["Customer"].ToString();
                this.lblInvoiceNumber.Text =dr["InvoiceNumber"].ToString();
                this.lblInvoiceDate.Text =Convert.ToDateTime(dr["InvoiceDate"].ToString()).ToShortDateString();
                this.lblReceiveMan.Text = dr["ReceiveMan"].ToString();
                this.lblInvoiceMoney.Text =dr["InvoiceMoney"].ToString();
                this.lblCreateUser.Text =dr["CreateUser"].ToString();
                this.lblCreateDepartment.Text =dr["CreateDepartment"].ToString();

                this.lblProjectInfoNumber.Text = dr["ProjectNumber"].ToString();
                this.lblProjectInfoName.Text = dr["ProjectName"].ToString();
                this.lblContractName.Text = dr["ContractName"].ToString();
            }
        }

    }
}